<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
<form action="login-servlet" method="post">
    <input type="text" id="username" name="username" placeholder="请输入用户名"><br />
    <input type="password" name="password" placeholder="请输入密码"><br />
    <button type="submit">登录</button>
    <input type="checkbox" name="remberMe" value="1" />记住我
</form>
<script>
    const index = document.cookie.indexOf('=');
    const username = document.cookie.substring(index + 1);
    document.getElementById("username").value = username;
</script>

</body>
</html>